home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / sider.zip / DATA_IN.LIB < prev    next >
Text File  |  1988-01-06  |  2KB  |  62 lines

  1. {***********************************************************************}
  2. var key,
  3.     s_code,
  4.     location : integer;
  5. {***********************************************************************}
  6. procedure key_in;                             {similar to Basic's INKEY$ }
  7. begin
  8.   with r do
  9.     begin
  10.       r.ax := $0000;
  11.       intr($16,r);
  12.       key := r.ax and $ff;                     {key code and }
  13.       s_code := r.ax shr 8;                    {scan code of key pressed}
  14.     end;
  15. end;
  16. {***********************************************************************}
  17. procedure scrn_attr(col,row,attribute: byte; long :integer);
  18. var where : integer;                             {Mono screen attributes}
  19. begin                                            {   0 = invisible      }
  20.   for i := 0 to long-1 do                        {   1 = underlined     }
  21.     begin                                        {   7 = normal         }
  22.       where := (col+i-1)*2+1 + (row-1)*160;      { 112 = reverse video  }
  23.       mem[scrn_seg:where] := attribute;
  24.     end;
  25. end;
  26. {***********************************************************************}
  27. function query(num,col,row,choice,long,lns: integer): integer;
  28. begin
  29.   scrn_attr(col,row+(choice*lns)-lns,112,long);
  30.   repeat
  31.     repeat key_in;
  32.       until s_code in [28,72,80];
  33.         scrn_attr(col, row+(choice*lns)-lns,7,long);
  34.         if (s_code = 72) then choice := choice-1 else
  35.         if (s_code = 80) then choice := choice+1;
  36.       choice := 1 +(choice +num -1) mod num;
  37.       scrn_attr(col, row+(choice*lns)-lns,112,long);
  38.     until key = 13;
  39.     query := choice;
  40. end;
  41. {**********************************************************************}
  42. function menu123(num,col,row,choice,long:integer): integer;
  43. var col_num : array [1..5] of integer;
  44. begin
  45. col_num[1] := 19;
  46. col_num[2] := 29;
  47. col_num[3] := 40;
  48. col_num[4] := 48;
  49. col_num[5] := 58;
  50. scrn_attr(col_num[choice],row,112,long);
  51.   repeat
  52.     repeat key_in
  53.       until s_code in [28,75,77];
  54.         scrn_attr(col_num[choice],row,7,long);
  55.         if (s_code = 77) then choice := choice +1 else
  56.         if (s_code = 75) then choice := choice -1;
  57.       choice := 1 +(choice +num -1) mod num;
  58.       scrn_attr(col_num[choice],row,112,long);
  59.   until key =13;
  60.   menu123 := choice;
  61. end;
  62.